<?php

/*
 *
 *
 * This software has been made FREELY available by author for interest of the developers. 
 *      I hope this will help you in coding faster and robust php application
 *            You can modify and use it as you it suits you.
 *              Your comments, suggestions and corrections 
 *                          will be highly 
 *                           APPRECIATED. 
 *                                      Thanks, 
 *                                      Author
 * @author :   Roshan Budhathoki (contact@roshanbudhathoki.com);
 * @URL    :   <http://www.roshanbudhathoki.com>
 *
 */

abstract class base {
	protected $_view;
	public function __construct() {
	}
	
	public function run() {
	}
	
	
	public function setView($view = '') {
		$this->_view=$view;
	}
	
	public function dispatch($view='') {
		if($view!=''){
			$this->setView($view);
		}else if($this->_view==''){
			throw new Exception('Empty view or no view file specified');	
		}
		include template_path () . $this->_view;
	}
}